import request from '@/utils/request';

// 获取路由
export const allList = (params: any) => {
    return request({
        url: '/tienchin/clue/list',
        method: 'get',
        params,
    });
};
// 渠道来源
export const channels = () => {
    return request({
        url: '/tienchin/clue/channels',
        method: 'get',
    });
};
//活动信息
export const activity = (id: any) => {
    return request({
        url: '/tienchin/clue/activity/' + id,
        method: 'get',
    });
};
// 新增
export function newAdd(data: any) {
    return request({
        method: 'post',
        url: 'tienchin/clue',
        // post请求的参数放data里
        data,
    });
}
// 修改根据id获取数据
export const editIdcon = (id: any) => {
    return request({
        url: 'tienchin/clue/summary/' + id,
        method: 'get',
    });
};
// 修改
export function editClue(data: any) {
    return request({
        method: 'put',
        url: 'tienchin/clue',
        // post请求的参数放data里
        data: data,
    });
}
// 删除
export function deleteList(id: any) {
    return request({
        method: 'delete',
        url: 'tienchin/clue/' + id,
        // data: id,
    });
}
// 树形选择器
export const treeSelect = () => {
    return request({
        url: '/system/dept/treeselect',
        method: 'get',
    });
};
//  分配给
export const allocationget = (id: any) => {
    return request({
        url: 'tienchin/clue/users/' + id,
        method: 'get',
    });
};
// 跳转页面
export const jumpData = (id: any) => {
    return request({
        url: 'tienchin/clue/' + id,
        method: 'get',
    });
};
// 提交
export function submitData(data: any) {
    return request({
        method: 'post',
        url: '/tienchin/clue/follow',
        data,
    });
}
// 转为商机

export function getBusiness(id: any) {
    return request({
        method: 'post',
        url: 'tienchin/clue/to_business/' + id,
    });
}
//  无效线索

export function getUnuse(data: any) {
    return request({
        method: 'post',
        url: 'tienchin/clue/invalid',
        data,
    });
}
